<template>
	<view class="itemcard">
		<view class="text1">
			<view> {{item.name}} </view>
			<u-tag :text="item.stateDesc" :type="tagtype" shape="circle" size="mini"></u-tag>
		</view>
		<view class="text2">
			<u--image :showLoading="true" :src="fang" width="32rpx" height="32rpx"></u--image>
			<view class="text3"> {{item.categoryDesc}} </view>
		</view>
		<view class="btnbox">
			<u--image :showLoading="true" :src="btn" width="176rpx" height="72rpx" @click="goxq()"></u--image>
		</view>
	</view>
</template>

<script>
	import fang from "@/static/project/fang.png";
	import btn from "@/static/project/btn.png";
	export default {
		name: "itemcard",

		props: {
			item: {
				type: Object,
				default: () => {
					return {}
				}
			}
				
		},
		data() {
			return {
				btn,
				fang,
				taglist:[
					{
						name:"筹备",
						type:"color1"
					},
					{
						name:"立项",
						type:"color2"
					},
					{
						name:"在建",
						type:"color3"
					},
					{
						name:"竣工",
						type:"color4"
					},
					{
						name:"停工",
						type:"color5"
					},
					{
						name:"完工",
						type:"color6"
					},
				]
			};
		},
		computed: {
			tagtype(){
				return this.taglist.find(item=>item.name==this.item.stateDesc).type||"color1"
			}

},
		methods: {
			goxq() {
				uni.navigateTo({
					url: "/pages/xmxq/xmxq?id="+this.item.id +'&name='+this.item.name
				})
			},
		
		},
		onLoad() {},
	};
</script>

<style lang="scss" scoped>
	.itemcard {
		margin: 32rpx;
		background: rgba(255, 255, 255, 0.1);
		border-radius: 24rpx;
		padding: 34rpx;
		padding-bottom: 18rpx;
		color: #fff;

		.btnbox {
			display: flex;
			justify-content: flex-end;
		}

		.text1 {
			font-size: 32rpx;
			line-height: 42rpx;
			display: flex;
			justify-content: space-between;
			// align-items: center;
		}

		.text2 {
			display: flex;
			align-items: center;
			height: 72rpx;

			.text3 {
				padding-left: 16rpx;
				color: #b6b6b6;
				font-size: 28rpx;
			}
		}
	}
</style>